﻿/**
<code>
  <author name="Zealic" email="zealic(at)gmail.com" type="Creator"/>
</code>
**/
using System;


namespace Zealib.Extensions
{   
    /// <summary>
    /// Extensions for <seealso cref="System.IO.BinaryReader"/> class.
    /// </summary>
    public static class ArraySegmentExtensions
    {
        public static T[] ToArray<T>(this ArraySegment<T> self)
        {
            self.Array.IsNotNull();
            T[] dest = new T[self.Count];
            Array.Copy(self.Array, self.Offset, dest, 0, self.Count);
            return dest;
        }


    }

}
